﻿namespace SS.WPF.Toolkit.PropertyEditor.Comparer
{
    using System;
    using System.Collections.Generic;

    public class ByNameComparer : IComparer<Property>
    {
        public int Compare(Property x, Property y)
        {
            if (ReferenceEquals(x, null) || ReferenceEquals(y, null))
            {
                return 0;
            }
            return ReferenceEquals(x, y) ? 0 : string.Compare(x.Name, y.Name, StringComparison.OrdinalIgnoreCase);
        }
    }
}
